<template>
  <h1>HelloWorld</h1>
</template>

<script>
import { request } from "../utils/request";
export default {
  name: "HelloWorld",
  props: {
    msg: String
  },
  data() {
    return {};
  },
  created() {
    this.getMessage();
  },
  methods: {
    getMessage() {
      request({
        url: "list?page=1&limit=10"
        //get请求参数： params: {
        //   page: 1,
        //   limit: 10
        // }
        //post请求参数： data: { page: 1, limit: 10 }

        //  method: "get"
      })
        .then(res => {
          console.log(res);
        })
        .catch(err => {
          console.log(err);
        });
    }
  }
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
